import request from '@/utils/request'

export function getAssurance(businessId) {
  return request({
    url: '/business/report/'+businessId,
    method: 'get'
  })
}
/**
 * 查询鉴证业务列表
 * @param query
 */
export function listAssurance(query) {
  return request({
    url: '/business/report/list',
    method: 'get',
    params: query
  })
}

export function getAassurance(query) {
  return request({
    url: '/business/report/getCoverImgList',
    method: 'get',
    params: {
      ids:query
    }
  })
}
/** 查询鉴证业务草稿箱列表 */
export function listDraftAssurance(query) {
  return request({
    url: '/business/report/list/draft',
    method: 'get',
    params: query
  })
}

// 新增事务所
export function addAssurance(data) {
  return request({
    url: '/business/report',
    method: 'post',
    data: data
  })
}
// 鉴证业务数据保存草稿
export function saveDraft(data){
  return request({
    url: '/business/report/saveDraft',
    method: 'post',
    data: data
  })
}

//需审核事务所录入
export function approveAdd(data){
  return request({
    url: '/business/report/approveAdd',
    method: 'post',
    data: data
  })
}
// 上证事务所录入数据
export function scipaSave(data){
  return request({
    url: '/business/report/scipaSave',
    method: 'post',
    data: data
  })
}

//预上传事务所录入
export function preUploadSave(data){
  return request({
    url: '/business/report/preUploadSave',
    method: 'post',
    data: data
  })
}

// 删除报告
export function delAssurance(data) {
  return request({
    url: '/business/report/remove'+"?"+"businessIdS="+data,
    method: 'post',
  })
}

// 编辑事务所
export function editAssurance(data) {
  return request({
    url: '/business/report',
    method: 'put',
    data: data
  })
}

/** 鉴证业务 申请退回 */
export function putReturn(data) {
  return request({
    url: '/business/report/return',
    method: 'get',
    params: data
  })
}
// 获取修改历史
export function getEditHistoryByBusinessId(businessId){
  return request({
    url: '/business/report/getEditHistoryByBusinessId',
    method: 'get',
    params: {
      businessId:businessId
    }
  })
}

/** 财政申请退回与数据异常，待审核列表 list*/
export function getPassList(query) {
  return request({
    url: '/business/report/list/approval',
    method: 'get',
    params: query
  })
}
// 获取需审核事务所业务报告不通过原因
export function getFailedReason(businessId){
  return request({
    url: '/business/report/getFailedReason',
    method: 'get',
    params: {
      businessId:businessId
    }
  })
}
// 获取业务报告作废原因
export function getVoidReason(businessId){
  return request({
    url: '/business/report/getVoidReason',
    method: 'get',
    params: {
      businessId:businessId
    }
  })
}

// 获取申请财政退回原因
export function getApplyReturnReason(businessId){
  return request({
    url: '/business/report/getApplyReturnReason',
    method: 'get',
    params: {
      businessId:businessId
    }
  })
}

// 获取申请财政退回不通过原因
export function getApplyReturnNoReason(businessId){
  return request({
    url: '/business/report/getApplyReturnNoReason',
    method: 'get',
    params: {
      businessId:businessId
    }
  })
}

/** 财政申请退回 同意/不同意 */
export function getAssurancePass(data) {
  return request({
    url: '/business/report/passOrNoPass',
    method: 'put',
    data: data
  })
}

// 保存事务所预上传字段配置
export function preUploadConfig(data){
  return request({
    url: '/business/report/preUploadConfig',
    method: 'put',
    data: data
  })
}
/** 根据防伪编码获取鉴证业务数据报告 详细信息*/
export function getAntiCode(antiCounterfeitingCoding) {
  return request({
    url: '/business/report/antiCounterfeitingCoding?antiCode=' + antiCounterfeitingCoding,
    noauth: true,
    method: 'get',
  })
}
/** 业务报告比对结果页*/
export function getCompareData(bussinessId) {
  return request({
    url: '/business/report/getTempAndBusinessData?businessId=' + bussinessId,
    method: 'get',
  })
}

/**
 * 作废业务数据
 * @param businessId
 * @param reason
 */
export function voidBusinessData(data){
  return request({
    url: '/business/report/voidBusinessData',
    method: 'get',
    params: data
  })
}
/** 待审核事务所数据审核 */
export function examineBusinessDataPass(data){
  return request({
    url: '/business/report/auditImportReport',
    method: 'post',
    data: data
  })
}
/** 强审通过/不予报备 */
export function strongExamineBusinessDataPass(data){
  return request({
    url: '/business/report/approval',
    method: 'get',
    params: data
  })
}

/** 检查事务所名称是否存在 */
export function checkFirmName(firmName){
  return request({
    url: '/business/report/checkFirmName',
    method: 'get',
    params: {
      firmName: firmName
    }
  })
}

// 鉴证业务数据导出
export function exportBussinessData(params){
  return request({
    url: '/business/report/exportBusinessData',
    method: 'get',
    params: params
  })
}

// 申请财政退回业务数据导出
export function exportBusinessRefundData(params){
  return request({
    url: '/business/report/exportBusinessRefundData',
    method: 'get',
    params: params
  })
}
// 上注协导入后 传递编号
export function getImportByTaskNo(taskNo){
  return request({
    url: '/business/report/getImportProgressByTaskNo?taskNo=' + taskNo,
    method: 'get',
  })
}

//导出鉴证业务报告历史数据
export function importEditHistory(businessId){
  return request({
    url: '/business/report/importEditHistory/' + businessId,
    method: 'get',
  })
}

//获取待办事项
export function approvalCount(){
  return request({
    url: '/business/report/approvalCount',
    method: 'get',
  })
}

